package com.example.lib_net.model.api

import com.google.gson.Gson
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody

/**
 * @author yaotianxue
 * @description 所有请求体基类
 * @date 2025/2/5
 */
open class BaseRequestBody {
    fun toRequestBody(): RequestBody {
        return Gson().toJson(this).toRequestBody("application/json".toMediaType())
    }
}